<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
error_reporting(0);
require_once './Config.php';
require_once './Tencent.php';
session_start();
//print_r($_SESSION);
OAuth::init($client_id, $client_secret);
Tencent::$debug = $debug;

$r = Tencent::api('user/info');
print_r(json_decode($r, true));
echo '</pre>';
echo "<br>";
echo "<br>";
echo "<br>";
$params = array(
    'content' => '这是一条测试，:)!',
    'pic_url' => 'http://www.mhtml5.com/wp-content/uploads/2011/09/facebook-logo.jpg'
);
$r = Tencent::api('t/add_pic_url', $params, 'POST');
print_r($rr=json_decode($r, true));

echo $tid=$rr["data"]["id"];

$params = array(   
    'id' =>"121858046148487"  ,
    'format'=>'json'
);
$r = Tencent::api('t/show', $params, 'GET');

print_r($rr=json_decode($r, true));
echo "发布微博后可以获取相应的返回数组，来判定是否已经发布成功的状态，结合需求确定是否获得积分奖励";
?>
